/*
 * @Descripttion:
 * @LastEditors: xzh
 * @LastEditTime: 2023-09-19 19:14:20
 */
import { object_Inf } from "@/utils/typings/index.type";
import request from "@/utils/request";
import organizeManage_APi from "../organizeManage";

/*
 * @Descripttion:生产工单管理接口
 * @LastEditors: xzh
 * @LastEditTime: 2023-09-14 17:48:58
 */
export default class productOrderManage_APi extends organizeManage_APi {
  //#region 生产工单接口

  /**
   * @Author: xzh
   * @Descripttion:保存生产工单信息
   * @Param:
   * @param {object} data
   */
  static saveProductOrder = (data: object): Promise<object_Inf> =>
    request({
      url: "/api/MouldStatus/SaveMouldStatus",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 删除生产工单信息
   * @Param:
   * @param {Array} data
   */
  static deleteProductOrder = (data: Array<string>): Promise<object_Inf> =>
    request({
      url: "/api/MouldStatus/DeleteMouldStatus",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取生产工单信息
   * @Param:
   * @param {number} id 生产工单主键
   */
  static getProductOrderInfo = (id: number): Promise<object_Inf> =>
    request({
      url: "/api/MouldStatus/GetMouldStatus",
      method: "get",
      params: { id },
    });
  /**
   * @Author: xzh
   * @Descripttion: 修改模具类型状态
   * @Param:
   * @param {Array} data
   */
  static updateProductOrderStatus = (
    data: Array<string>,
    status: boolean
  ): Promise<object_Inf> =>
    request({
      url: "/api/MouldStatus/UpdateMouldStatusStatus",
      method: "post",
      data: {
        ids: data,
        status,
      },
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion:获取生产工单列表
   * @Param:
   */
  static getProductOrderList = (
    data: object_Inf = {
      keyWord: "",
    }
  ): Promise<object_Inf> =>
    request({
      url: "/api/MouldStatus/GetMouldStatusList",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });

  //#endregion
}
